
<template>
    <uni-data-checkbox v-model="value" :localdata="range" @change="change"></uni-data-checkbox>
    <!-- <switch :checked="value" @change="change" style="transform:scale(0.7)"></switch> -->
</template>
<script setup lang="ts">
import { ref, watch } from 'vue';
const value = ref("0")
const props = defineProps({
    modelValue: {
        type: String,
    }
})
const range = [{
    "value": "0",
    "text": "否"
},
{
    "value": "1",
    "text": "是",
},]

watch(() => props.modelValue, (newValue) => {
    if (newValue) {
        value.value = newValue
    }
})
if (props.modelValue) {
    value.value = props.modelValue
}
const emits = defineEmits(['update:modelValue']);

const change = ({ detail: { value } }: any) => {
    emits('update:modelValue', value)
}
</script>
<style lang="scss" scoped>

</style>
